python/xc: fix out of bounds array access
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 15 Jun 2010 12:27:14 +0000 (13:27 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 15 Jun 2010 12:27:14 +0000 (13:27 +0100)
Writing a NUL terminator here isn't even necessary, since snprintf()
already guarantees proper termination.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
tools/python/xen/lowlevel/xc/xc.c

index 7330191ebd70f53d4eed62f1788c733f52f355e0..a7286c4e85270ffcfab77150e82d8b74f02cd411 100644 (file)
@@ -58,7 +58,6 @@ static PyObject *pyxc_error_to_exception(xc_interface *xch)
         snprintf(err_buf.message, sizeof(err_buf.message),
                  "xc_interface_open failed: %s",
                  strerror(errno));
-        err_buf.message[sizeof(err_buf)-1] = 0;
         err_buf.code = XC_INTERNAL_ERROR;
         err = &err_buf;
     }